package com.huonan.jb.tools.sftpuse;

import cn.hutool.core.io.FileUtil;
import cn.hutool.db.nosql.redis.RedisDS;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.hutool.setting.Setting;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.*;

public class SftpApp {
    public static void main(String[] args) {
        List<String> sftpFiles = new ArrayList<>();
        for (String file : sftpFiles) {
            List<String> lines = FileUtil.readUtf8Lines(file);
            BufferedReader reader = FileUtil.getReader(file, "UTF-8");
            String line = null;
            Map<String, String> map = new HashMap<>();
            try {
                if ((line = reader.readLine()) != null) {
                    JSONObject jsonObject = JSONUtil.parseObj(line);
                    String kwId = jsonObject.getStr("kw_id");
                    map.put(kwId, line);
                }
                //拆分
                catchSeverMaptch(map.keySet());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }

    public static List<String> catchSeverMaptch(Set<String> list) {
        Setting setting = Setting.create();
        RedisDS redisDS = RedisDS.create(setting,"a");

        return null;
    }
}
